package com.example.takeaway.api.common;

import com.example.takeaway.common.R;
import com.example.takeaway.model.PageVO;
import com.example.takeaway.model.dto.CategoryDTO;
import com.example.takeaway.model.dto.CategoryEditorDTO;
import com.example.takeaway.model.vo.CategoryVO;
import com.example.takeaway.service.CategoryService;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.Collections;
import java.util.List;
import java.util.Map;

/**
 * <p>
 * 分类表 前端控制器
 * </p>
 *
 * @author 邢晨旭
 * @since 2023-10-12
 */
@RestController
@RequestMapping("/public/category")
public class CategoryPublicApi {

    @Resource
    CategoryService categoryService;

    @GetMapping("/list/{id}")
    public R<List<CategoryVO>> list(@PathVariable("id") Long shopId) {
        return R.ok(categoryService.queryList(shopId));
    }
}
